/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package byblos.negocio.reserva.prereserva;

import byblos.negocio.acomodacao.TipoAcomodacao;
import byblos.negocio.pacote.Pacote;
import byblos.negocio.reserva.Reserva;
import byblos.negocio.reserva.ReservaUtil;
import byblos.util.DataUtil;
import java.util.Calendar;
import java.util.List;

/**
 *
 * @author helena
 */
public abstract class PreReserva {

    private TipoAcomodacao tipoAcomodacao;

    public PreReserva(TipoAcomodacao tipo) {
        this.tipoAcomodacao = tipo;
    }

    public TipoAcomodacao getTipoAcomodacao() {
        return tipoAcomodacao;
    }

    public List<Reserva> getReservas() {
        return new ReservaUtil().getReservas(this);
    }

    public Pacote getPacote() {
        return null;
    }

    public abstract Calendar getCheckin();

    public Calendar getCheckout() {
        if (getCheckin() == null) {
            return null;
        }
        return DataUtil.getCalendar(DataUtil.getDateTime(getCheckin()).plusDays(getNumeroNoites()));
    }

    public abstract int getNumeroNoites();

    public String getStringCheckin() {
        return DataUtil.toString(getCheckin());
    }

    public String getStringCheckout() {
        return DataUtil.toString(getCheckout());
    }

    public String getStringPeriodoHospedagem() {
        return getStringCheckin() + " - " + getStringCheckout();
    }
}
